module.exports = app => {
  const mongoose = app.mongoose;
  const UserSchema = new mongoose.Schema({
    userName: {
      type: String,
      unique: true,
      required: true
    },
    password: {
      type: String,
      required: true
    },
    avatar:{
      type: String,
      default: 'http://29e5534ea20a8.cdn.sohucs.com/c_zoom,h_213/c_cut,x_222,y_0,w_667,h_445/os/news/9ef4ab0fbaba028d39b6568dd9770881.jpg'
    },
    createAt: {
      type: Date,
      default: Date.now
    }
  })
  return mongoose.model('User', UserSchema)
}